import request from '@/utils/request'

export function getDiihooConfig() {
  return request({
    url: '/parking/dashboard/getDiihooConfig',
    method: 'post',
  })
}

// 系统配置
export function getSystemConfig(params) {
  return request({
    url: '/parking/dashboard/getSystemConfig',
    method: 'get',
    params
  })
}

// 机房相机抓图接口
export function getZoneCapture(params) {
  return request({
    url: '/parking/dashboard/getZoneCapture',
    method: 'get',
    params
  })
}

export function queryPlateNo(plateNo) {
  return request({
    url: '/parking/dashboard/search',
    method: 'get',
    params: { "rectifyResult": plateNo }
  })
}

/**
 * 相机列表
 * @param query
 * @returns {AxiosPromise}
 */
export function listNetcamera(query) {
  return request({
    url: '/parking/dashboard/listNetcamera',
    method: 'get',
    params: query
  })
}

/**
 * 无人寻呼
 * @param query
 * @returns {AxiosPromise}
 */
export function listUnattended(query) {
  return request({
    url: '/parking/dashboard/listUnattended',
    method: 'get',
    params: query
  })
}

/**
 * 查询停车记录
 * @param query
 * @returns {AxiosPromise}
 */
export function listParkingRecord(query) {
  return request({
    url: '/parking/dashboard/listParkingRecord',
    method: 'get',
    params: query
  })
}


/**
 * 获取停车场最近10条动态
 * @param query
 * @returns {AxiosPromise}
 */
export function listParkingRecordLast10(query) {
  return request({
    url: '/parking/dashboard/listParkingRecordLast10',
    method: 'get',
    params: query
  })
}


/**
 * 获取今日统计数据
 * @param query
 * @returns {AxiosPromise}
 */
export function getTodayParkingCount(query) {
  return request({
    url: '/parking/dashboard/getTodayParkingCount',
    method: 'get',
    params: query
  })
}

/**
 * 修改车牌
 * @param query
 * @returns {AxiosPromise}
 */
export function rectifyPlateNo(query) {
  return request({
    url: '/parking/dashboard/rectifyPlateNo',
    method: 'post',
    params: query
  })
}

/**
 * 查询订单金额
 * @param query
 * @returns {AxiosPromise}
 */
export function queryVisitorOrder(query) {
  return request({
    url: '/parking/dashboard/queryVisitorOrder',
    method: 'post',
    params: query
  })
}

/**
 * 进出场开闸接口
 * @param query
 * @returns {AxiosPromise}
 */
export function exitGate(query) {
  return request({
    url: '/parking/dashboard/exitGate',
    method: 'post',
    params: query
  })
}

/**
 * 开闸
 * @param query
 * @returns {AxiosPromise}
 */
export function openGate(query) {
  return request({
    url: '/parking/dashboard/openGate',
    method: 'post',
    params: query
  })
}

/**
 * 落闸
 * @param query
 * @returns {AxiosPromise}
 */
export function downGate(query) {
  return request({
    url: '/parking/dashboard/downGate',
    method: 'post',
    params: query
  })
}

/**
 * 落闸
 * @param query
 * @returns {AxiosPromise}
 */
export function connectDashBoard(query) {
  return request({
    url: '/parking/dashboard/connect',
    method: 'post',
    params: query
  })
}

/**
 * 查询折扣列表
 * @param query
 * @returns {AxiosPromise}
 */
export function queryDiscountList(query) {
  return request({
    url: '/parking/dashboard/queryDiscountList',
    method: 'post',
    params: query
  })
}

/**
 * 打折
 * @param query
 * @returns {AxiosPromise}
 */
export function discounting(query) {
  return request({
    url: '/parking/dashboard/discounting',
    method: 'post',
    params: query
  })
}

/**
 * 小区云值守中心-报警详情 统计
 * @param query
 * @returns {AxiosPromise}
 */
export function getAlarmOrderStatistics(query) {
  return request({
    url: '/parking/dashboard/getAlarmOrderStatistics',
    method: 'get',
    params: query
  })
}

/**
 * 人工消单
 * @param query
 * @returns {AxiosPromise}
 */
export function handleOrder(query) {
  return request({
    url: '/parking/dashboard/handleOrder',
    method: 'get',
    params: query
  })
}

/**
 * 小区云值守中心-报警统计
 * @param query
 * @returns {AxiosPromise}
 */
export function getAlarmOrderCount(query) {
  return request({
    url: '/parking/dashboard/getAlarmOrderCount',
    method: 'get',
    params: query
  })
}


/**
 * 获取小区所有机房信息
 * @param query
 * @returns {AxiosPromise}
 */
export function listRegionAllZoneInfo(query) {
  return request({
    url: '/parking/dashboard/listRegionAllZoneInfo',
    method: 'get',
    params: query
  })
}

/**
 * 巡检组列表
 * @param query
 * @returns {AxiosPromise}
 */
export function getGroupList(query) {
  return request({
    url: '/parking/netcamera/group/list',
    method: 'get',
    params: query
  })
}

/**
 * 删除巡检组
 * @param query
 * @returns {AxiosPromise}
 */
export function delGroupItem(id) {
  return request({
    url: '/parking/netcamera/group/' + id,
    method: 'delete',
    // params: query
  })
}

/**
 * 获取巡检组信息
 * @param query
 * @returns {AxiosPromise}
 */
export function getGroupId(netcameraGroupId) {
  return request({
    url: '/parking/netcamera/group/' + netcameraGroupId,
    method: 'get'
  })
}
// /parking/netcamera/group
/**
 * 新增巡检组
 * @param data
 * @returns {AxiosPromise}
 */
export function addGroup(data) {
  return request({
    url: '/parking/netcamera/group',
    method: 'post',
    data: data
  })
}

/**
 * 获取堵车详情
 */
export function getGateTraffic() {
  return request({
    url: '/parking/service/getGateTraffic',
    method: 'get'
  })
}
/**
 * 查询当前道闸口停留的车辆
 */
export function gateCurrent(params) {
  return request({
    url: '/parking/service/gateCurrent',
    method: 'get',
    params
  })
}
/**
 * 通道设备控制
 */
export function gateControl(params) {
  return request({
    url: '/parking/service/gateControl',
    method: 'get',
    params
  })
}
/**
 * 修改入场车牌
 */
export function carUpdate(params) {
  return request({
    url: '/parking/service/carUpdate',
    method: 'get',
    params
  })
}
/**
 * 查询入场纪录
 */
export function carQuery(params) {
  return request({
    url: '/parking/service/carQuery',
    method: 'get',
    params
  })
}
/**
 * 手动匹配入场
 */
export function carMatch(params) {
  return request({
    url: '/parking/service/carMatch',
    method: 'get',
    params
  })
}
// 查询计费
export function carCalc(params) {
  return request({
    url: '/parking/service/carCalc',
    method: 'get',
    params
  })
}
// 二次报警接口触发
export function secondAlarm(data) {
  return request({
    url: '/parking/dashboard/secondAlarm',
    method: 'post',
    data: data
  })
}

// 拍照
export function getCapture(params) {
  return request({
    url: '/routing/inspection/record/capture',
    method: 'get',
    params
  })
}
// 执行
export function getExecute(data) {
  return request({
    url: '/routing/inspection/record/execute',
    method: 'post',
    data
  })
}
// 提交
export function submit(data) {
  return request({
    url: '/routing/inspection/record/submit',
    method: 'post',
    data
  })
}
// 月度统计
export function getStatistics(params) {
  return request({
    url: '/routing/inspection/record/statistics',
    method: 'get',
    params
  })
}

// 巡检工单信息
export function getRecordById(id) {
  return request({
    url: `/routing/inspection/record/${id}`,
    method: 'get',
    params:{}
  })
}

// 巡检组列表
export function getList(params) {
  return request({
    url: `/routing/inspection/record/list`,
    method: 'get',
    params
  })
}

// 巡检页面 视频点击弹窗详情获取
export function getTodayCount(params) {
  return request({
    url: `/routing/inspection/record/getTodayCount`,
    method: 'get',
    params
  })
}
